home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2002 January / PC Answers January 2002.7z / PC Answers January 2002.bin / graphics / freepixl / _SETUP.1 / dlgsampl.pxl < prev    next >
Text File  |  2000-12-23  |  5KB  |  137 lines

  1. { PiXCL Code fragments for the DialogBox command:  
  2.     Fdx1, Fdy1 are the TL corner coords for the dialogs created by the subroutines  }
  3. {
  4.  
  5. NewFileCreateDlg: {subroutine}
  6.     Fdx2 = Fdx1 + 180
  7.     Fdy2 = Fdy1 + 70
  8.     List$ = "blank 8 bit Feature file|blank 24 bit Feature file|blank Theme file|Feature PAL file|Theme PAL file"
  9.     DialogBox(Fdx1,Fdy1,Fdx2,Fdy2,"Create a new file",CAP_NCTR, 5,5,32,32,ICON07,
  10.              143,28,178,43,"&OK",2,Res, {0 = OK}
  11.              143,48,178,63,BTN,PUSH,"&Cancel", {1 = Cancel}
  12.              20,5,140,68,LIST,MULTI,List$,Selection$)
  13.     {do something with the selection}
  14.      Return
  15.  
  16.  
  17.  
  18. NormalizerRange:
  19.     WaitInput(1)
  20.     LoRange$ = "20"  HiRange$ = "220"
  21.     Fdx1 = 100     Fdy1 = 40
  22.     FunctionDialogTitle$ = "Set Normalize Range Values"
  23.     GoSub ShowFunctionDialog2 {returns FDRes}
  24.     If FDRes = 1
  25.         Val(LoRange$,LoRange,Res)
  26.         Val(HiRange$,HiRange,Res)
  27.         NormalizeImageRange(LoRange,HiRange,Res)
  28.         If Res <> 0 Then ZoomBitmapWindow(Bmw1,ImageFile$,0,0,0,INCREMENT)
  29.         If HistogramFlag = 1 Then GoSub DisplayRGBChannelHistograms
  30.     Endif
  31.      Goto Wait_for_Input
  32.  
  33. GammaCorrector:
  34.     WaitInput(1)
  35.     HiRange$ = "220"
  36.     MidRange$ = "220"
  37.     LoRange$ = "220"
  38.     Fdx1 = 100     Fdy1 = 40
  39.     FunctionDialogTitle$ = "Set Gamma Values (x100)"
  40.     GoSub ShowFunctionDialog3  {returns FDRes}
  41.     If FDRes = 1
  42.         Val(HiRange$,RedGamma,Res)
  43.         Val(MidRange$,GreenGamma,Res)
  44.         Val(LoRange$,BlueGamma,Res)
  45.         GammaCorrectImage(RedGamma,GreenGamma,BlueGamma,Res)
  46.         If Res <> 0 Then ZoomBitmapWindow(Bmw1,ImageFile$,0,0,0,INCREMENT)
  47.         If HistogramFlag = 1 Then GoSub DisplayRGBChannelHistograms
  48.     Endif
  49.      Goto Wait_for_Input
  50.  
  51. {Following sample dialogs are often usable in programs.  The title is set by 
  52.   FunctionDialogTitle$         and the TLcorner position in the application client are 
  53.   set by Fdx1 and Fdx2.
  54.   The return variables are
  55.      FDres    - returns the button code: 0 for Cancel, 1 for OK,
  56.     InputValue$, LoRange$, MidRange$, HiRange$
  57.   These four strings have to be converted by your PiXCL code into the 
  58.   desired integer variables.   }
  59.  
  60. ShowFunctionDialog1: {subroutine: one numeric input }
  61.     Fdx2 = Fdx1 + 150
  62.     Fdy2 = Fdy1 + 50
  63.     DialogBox(Fdx1, Fdy1,Fdx2,Fdy2,FunctionDialogTitle$,CAP_NCTR,
  64.         5,15,24,24,QUESTION,
  65.         110,25,145,40,"&Cancel",4,FDRes,  {returns 0}
  66.         110,5,145,20,BTN,PUSH,"&OK",  {returns 1}
  67.         20,5,105,45,BTN,GROUP,"Numeric Input", {edit string}
  68.         48,23,100,33,STATIC,LEFT,"Input value", {edit string}
  69.         25,17,45,27,EDIT,NUMBER,InputValue$,InputValue$)
  70.     Return
  71.  
  72.  
  73. ShowFunctionDialog2: {subroutine: two numeric inputs}
  74.     Fdx2 = Fdx1 + 150
  75.     Fdy2 = Fdy1 + 50
  76.     DialogBox(Fdx1, Fdy1,Fdx2,Fdy2,FunctionDialogTitle$,CAP_NCTR,
  77.         5,15,24,24,QUESTION,
  78.         110,25,145,40,"&Cancel",6,FDRes,  {returns 0}
  79.         110,5,145,20,BTN,PUSH,"&OK",  {returns 1}
  80.         20,5,105,45,BTN,GROUP,"Numeric Input", {edit string}
  81.         48,17,100,27,STATIC,LEFT,"High range value", {edit string}
  82.         25,17,45,27,EDIT,NUMBER,HiRange$,HiRange$,
  83.         48,29,100,39,STATIC,LEFT,"Low range value", {edit string}
  84.         25,29,45,39,EDIT,NUMBER,LoRange$,LoRange$)
  85.     Return
  86.  
  87.  
  88. ShowFunctionDialog3: {subroutine: three numeric inputs}
  89.     Fdx2 = Fdx1 + 150
  90.     Fdy2 = Fdy1 + 65
  91.     DialogBox(Fdx1, Fdy1,Fdx2,Fdy2,FunctionDialogTitle$,CAP_NCTR,
  92.         5,15,24,24,QUESTION,
  93.         110,35,145,50,"&Cancel",8,FDRes,  {returns 0}
  94.         110,15,145,30,BTN,PUSH,"&OK",  {returns 1}
  95.         20,5,105,55,BTN,GROUP,"Numeric Input", {edit string}
  96.         48,17,100,27,STATIC,LEFT,"High range value", {edit string}
  97.         25,17,45,27,EDIT,NUMBER,HiRange$,HiRange$,
  98.         48,29,100,39,STATIC,LEFT,"Mid range value", {edit string}
  99.         25,29,45,39,EDIT,NUMBER,MidRange$,MidRange$,
  100.         48,41,100,51,STATIC,LEFT,"Low range value", {edit string}
  101.         25,41,45,51,EDIT,NUMBER,LoRange$,LoRange$)
  102.     Return
  103.  
  104. UserIDPasswordBox: {subroutine}
  105.     Fdx2 = Fdx1 + 230
  106.     Fdy2 = Fdy1 + 90
  107.     Msg$ = "Please enter your UserID and Password"
  108.     Info$ = "Information"
  109.     MoreInfo$ = "User IDs and Passwords are automatically checked by the Server. Once verified you will be logged into your secure user account."
  110.     DialogBox(Fdx1,Fdy1,Fdx2,Fdy2,"Custom Password Box using DialogBox command", CAP_NCTR,
  111.                350,110, 64,64, WINLOGO, 
  112.                170,35,220,50,"&OK",   6,   Res,
  113.                170,15,220,30,BTN,PUSH,"&Cancel",  
  114.                 25,2,165,18,STATIC, LEFT, Msg$ ,
  115.                 4,17,160,30,EDIT,STRING,"",UserID$,
  116.                 4,37,160,50,EDIT,PASSWORD,"",Pwd$,
  117.                 4,52,160,88,BTN,GROUP,Info$,
  118.                 6,60,158,87,STATIC,LEFT,MoreInfo$)
  119.  
  120.     Return
  121.  
  122. ShowListingControl: {subroutine}
  123.     Fdx2 = Fdx1 + 210
  124.     Fdy2 = Fdy1 + 160
  125.     Msg$ = "Fill this string with the initial text, eg with FileRead_ASCII"
  126.  
  127.     DialogBox(Fdx1,Fdy1,Fdx2,Fdy2,"Edit Control Dialog Box", CAP_NCTR,
  128.                15,25, 48,48, ICON01, 
  129.               30,145,80,158,"&Cancel", 2, Res,
  130.               130,145,180,158,BTN, PUSH,"&OK",
  131.               5,5,205,143,EDIT,MLSTRING,Msg$,Res2$)
  132.  
  133.     Return
  134. }
  135.  
  136.  
  137.